package com.xm.servlet.background.commodity;

import com.google.gson.Gson;
import com.xm.service.background.CommoditySpecificationTypeService;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 查询全部规格类别
 * @author 康文程
 * @date 2024-1-17
 */
@WebServlet("/background/get/all/commodity/specification")
public class GetAllCommoditySpecificationType extends HttpServlet {
    private final CommoditySpecificationTypeService service = new CommoditySpecificationTypeService();

    @SneakyThrows
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)  {
        resp.setContentType("text/html;charset=UTF-8");
        resp.getWriter().print(new Gson().toJson(service.getAllCommoditySpecificationTypes()));
    }
}
